﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SEC_MENU
// * CreateDate    : 2011/7/11 21:45:04
// * Creater       : CodeSmith
// * LastChangeDate: 2011/7/11 21:45:04
// * LastChanger   : 2011/7/11 21:45:04
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class SecMenuEntity : EntityBase
    {
        public SecMenuTable TableSchema
        {
            get
            {
                return SecMenuTable.Current;
            }
        }

        public SecMenuEntity()
        {

        }

        public SecMenuEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.MenuId = Convert.ToString(CommonFunctions.ToObject(dr["MENU_ID"]));
            this.ParentMenu = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_MENU"]));
            this.MenuTypeCode = Convert.ToString(CommonFunctions.ToObject(dr["MENU_TYPE_CODE"]));
            this.MenuName = Convert.ToString(CommonFunctions.ToObject(dr["MENU_NAME"]));
            this.ExeFile = Convert.ToString(CommonFunctions.ToObject(dr["EXE_FILE"]));
            this.FormName = Convert.ToString(CommonFunctions.ToObject(dr["FORM_NAME"]));
            this.Method = Convert.ToString(CommonFunctions.ToObject(dr["METHOD"]));
            this.OrderIndex = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_INDEX"]));
            this.ImageName = Convert.ToString(CommonFunctions.ToObject(dr["IMAGE_NAME"]));
            this.MasterFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["MASTER_FLAG"]));
        }

        public SecMenuEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.MenuId = Convert.ToString(CommonFunctions.ToObject(dr["MENU_ID"]));
            this.ParentMenu = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_MENU"]));
            this.MenuTypeCode = Convert.ToString(CommonFunctions.ToObject(dr["MENU_TYPE_CODE"]));
            this.MenuName = Convert.ToString(CommonFunctions.ToObject(dr["MENU_NAME"]));
            this.ExeFile = Convert.ToString(CommonFunctions.ToObject(dr["EXE_FILE"]));
            this.FormName = Convert.ToString(CommonFunctions.ToObject(dr["FORM_NAME"]));
            this.Method = Convert.ToString(CommonFunctions.ToObject(dr["METHOD"]));
            this.OrderIndex = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_INDEX"]));
            this.ImageName = Convert.ToString(CommonFunctions.ToObject(dr["IMAGE_NAME"]));
            this.MasterFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["MASTER_FLAG"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SecMenuTable.Current;
            }
        }

        #region Perporty List
        public string MenuId
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_MENU_ID)); }
            set { SetData(SecMenuTable.C_MENU_ID, value); }
        }

        public string ParentMenu
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_PARENT_MENU)); }
            set { SetData(SecMenuTable.C_PARENT_MENU, value); }
        }

        public string MenuTypeCode
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_MENU_TYPE_CODE)); }
            set { SetData(SecMenuTable.C_MENU_TYPE_CODE, value); }
        }

        public string MenuName
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_MENU_NAME)); }
            set { SetData(SecMenuTable.C_MENU_NAME, value); }
        }

        public string ExeFile
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_EXE_FILE)); }
            set { SetData(SecMenuTable.C_EXE_FILE, value); }
        }

        public string FormName
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_FORM_NAME)); }
            set { SetData(SecMenuTable.C_FORM_NAME, value); }
        }

        public string Method
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_METHOD)); }
            set { SetData(SecMenuTable.C_METHOD, value); }
        }

        public decimal OrderIndex
        {
            get { return Convert.ToDecimal(GetData(SecMenuTable.C_ORDER_INDEX)); }
            set { SetData(SecMenuTable.C_ORDER_INDEX, value); }
        }

        public string ImageName
        {
            get { return Convert.ToString(GetData(SecMenuTable.C_IMAGE_NAME)); }
            set { SetData(SecMenuTable.C_IMAGE_NAME, value); }
        }

        public int MasterFlag
        {
            get { return Convert.ToInt32(GetData(SecMenuTable.C_MASTER_FLAG)); }
            set { SetData(SecMenuTable.C_MASTER_FLAG, value); }
        }

        #endregion

        #region Object Properties
        private SecMenuEntity mParentMenuEntity;
        public SecMenuEntity ParentMenuEntity
        {
            get
            {
                return mParentMenuEntity;
            }
            set
            {
                mParentMenuEntity = value;
            }
        }
        #endregion
    }


}

